﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Class_KetNoi
{
   public class KetNoi_PhanQuyen:KetNoiCoSoDuLieu
    {
       public void them_PhanQuyen(string @TenPQ)
       {
           SqlCommand cmd = new SqlCommand("dbo.insert_PhanQuyen", cnn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlParameter p = new SqlParameter("@TenPQ", TenPQ);
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
       public void update_PhanQuyen(string @MaPQ, string @TenPQ)
       {
           SqlCommand cmd = new SqlCommand("dbo.update_PhanQuyen", cnn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlParameter p = new SqlParameter("@MaPQ",MaPQ);
           cmd.Parameters.Add(p);
           p = new SqlParameter("@TenPQ", TenPQ);
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
       public void xoa_PhanQuyen(string @MaPQ)
       {
           SqlCommand cmd = new SqlCommand("dbo.delete_PhanQuyen", cnn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlParameter p = new SqlParameter("@MaPQ",MaPQ);
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
    }
}
